package com.hedl.studyandjava8.test.practice;

/**
 * @author Big Watermelon
 * @description break 关键字用法
 * @date 2024/02/17/09:29
 */
public class StudyBreak {
    public static void main(String[] args) {
        int [] intary = {99,12,22,34,45,67,5678,8990};
        int on = 5678;
        int i = 0;
        boolean found = false;
        for (;i < intary.length; i++){
            if (intary[i] == on){
                found = true;
                break;
            }
        }
        if (found){
            System.out.println(on+" 元素的索引位置在: "+i);
        }else {
            System.out.println(on+" 元素不在数组中");
        }
    }
}
